<#include "/layout/layout.ftl">
<#import "/layout/macro.ftl" as macro>
<#import "/layout/select.ftl" as my/>
<#assign css>
<#--此ftl中用到的css-->
</#assign>
<#assign js>
<#--此ftl中用到的js-->
<script>
	$(".btn-submit").click(function () {
		// 校验表单合法
		var bootstrapValidator = $(".form-edit").data('bootstrapValidator');
		bootstrapValidator.validate();
		if(bootstrapValidator.isValid()){
			$.ajax({
				type: "POST",
				url: "/master/edit",
				data: $(".form-edit").serialize(),
				dataType: "JSON",
				success: function(res){
					layer.msg(res.message, {time: 2000
					}, function(){
						location.href="/master/index";
					});
				}
			});
		}else{
			return false;
		}
	});

	$('.form-edit').bootstrapValidator({
		message: '请输入有效值',
		feedbackIcons: {
			valid: 'glyphicon glyphicon-ok',
			invalid: 'glyphicon glyphicon-remove',
			validating: 'glyphicon glyphicon-refresh'
		}
	});

</script>
</#assign>
<@layout title="编辑" active="master">
<!-- Content Header (Page header) -->
<section class="content-header">
	<h1>
		<#if isAdd>
            新增
        <#else>
            编辑
        </#if>
		<small>师傅管理详细信息</small>
	</h1>
	<ol class="breadcrumb">
		<li><a href="/"><i class="fa fa-home"></i> 管理后台</a></li>
		<li><a href="#"><i class="fa fa-list-ul"></i> 师傅管理管理</a></li>
		<li class="active"><i class="fa fa-edit"></i>
		    <#if isAdd>
                新增
            <#else>
                编辑
            </#if>
		</li>
	</ol>
</section>
<!-- Main content -->
<section class="content">
	<div class="row">
		<div class="col-md-12">
			<!-- Default box -->
			<div class="box  box-primary">
				<form class="form-horizontal form-edit" method="post" action="master/edit">
					<div class="box-body">
						<input type="hidden" id="id" name="id" value="${master.id!}">
						<input type="hidden" id="isAdd" name="isAdd" value="${isAdd?string('true','false')}">
						<div class="form-group">
							<label class="col-sm-2 control-label">用户id：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入用户id" id="userId" name="userId" class="form-control" type="text" value="${master.userId!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">分站id：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入分站id" id="agentId" name="agentId" class="form-control" type="text" value="${master.agentId!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">创建时间：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入创建时间" id="createDt" name="createDt" class="form-control" type="text" value="${master.createDt!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">更新时间：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入更新时间" id="updateDt" name="updateDt" class="form-control" type="text" value="${master.updateDt!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">服务类型(字典表对照跑腿大类)：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入服务类型(字典表对照跑腿大类)" id="serviceType" name="serviceType" class="form-control" type="text" value="${master.serviceType!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">技能分类(对应分站上门品类Id)：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入技能分类(对应分站上门品类Id)" id="skillType" name="skillType" class="form-control" type="text" value="${master.skillType!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">开通地经度：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入开通地经度" id="longitude" name="longitude" class="form-control" type="text" value="${master.longitude!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">开通地维度：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入开通地维度" id="latitude" name="latitude" class="form-control" type="text" value="${master.latitude!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">1 一星，2 两星,3 三星,4 四星，5 五星,6 六星：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入1 一星，2 两星,3 三星,4 四星，5 五星,6 六星" id="masterStars" name="masterStars" class="form-control" type="text" value="${master.masterStars!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">评分：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入评分" id="score" name="score" class="form-control" type="text" value="${master.score!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">师傅姓名：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入师傅姓名" id="masterName" name="masterName" class="form-control" type="text" value="${master.masterName!}" >
							</div>
						</div>

					<div class="box-footer">
						<button type="button" class="btn btn-default btn-back">返回</button>
						<button type="button" class="btn btn-info pull-right btn-submit">提交</button>
					</div>

				</form>
			</div>
			<!-- /.box -->
		</div>
	</div>
</section>
<!-- /.content -->
</@layout>
